
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>nginx03Nginx常用命令 · Nginx</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="<yangxin19970404@163.com>">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    
    <link rel="prev" href="nginx02安装.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="nginx01代理.html">
            
                <a href="nginx01代理.html">
            
                    
                    nginx01代理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="nginx02安装.html">
            
                <a href="nginx02安装.html">
            
                    
                    nginx02安装
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4" data-path="nginx03Nginx常用命令.html">
            
                <a href="nginx03Nginx常用命令.html">
            
                    
                    nginx03Nginx常用命令
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >nginx03Nginx常用命令</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h3 id="nginx&#x5E38;&#x7528;&#x547D;&#x4EE4;">Nginx&#x5E38;&#x7528;&#x547D;&#x4EE4;</h3>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> /usr/<span class="hljs-built_in">local</span>/nginx/sbin/
./nginx  &#x542F;&#x52A8;
./nginx <span class="hljs-_">-s</span> stop  &#x505C;&#x6B62;
./nginx <span class="hljs-_">-s</span> quit  &#x5B89;&#x5168;&#x9000;&#x51FA;
./nginx <span class="hljs-_">-s</span> reload  &#x91CD;&#x65B0;&#x52A0;&#x8F7D;&#x914D;&#x7F6E;&#x6587;&#x4EF6;
ps aux|grep nginx  &#x67E5;&#x770B;nginx&#x8FDB;&#x7A0B;
</code></pre>
<p>&#x6CE8;&#x610F;&#xFF1A;&#x5982;&#x4F55;&#x8FDE;&#x63A5;&#x4E0D;&#x4E0A;&#xFF0C;&#x68C0;&#x67E5;&#x963F;&#x91CC;&#x4E91;&#x5B89;&#x5168;&#x7EC4;&#x662F;&#x5426;&#x5F00;&#x653E;&#x7AEF;&#x53E3;&#xFF0C;&#x6216;&#x8005;&#x670D;&#x52A1;&#x5668;&#x9632;&#x706B;&#x5899;&#x662F;&#x5426;&#x5F00;&#x653E;&#x7AEF;&#x53E3;&#xFF01;
&#x76F8;&#x5173;&#x547D;&#x4EE4;&#xFF1A;</p>
<pre><code class="lang-bash"><span class="hljs-comment"># &#x5F00;&#x542F;</span>
service firewalld start
<span class="hljs-comment"># &#x91CD;&#x542F;</span>
service firewalld restart
<span class="hljs-comment"># &#x5173;&#x95ED;</span>
service firewalld stop
<span class="hljs-comment"># &#x67E5;&#x770B;&#x9632;&#x706B;&#x5899;&#x89C4;&#x5219;</span>
firewall-cmd --list-all
<span class="hljs-comment"># &#x67E5;&#x8BE2;&#x7AEF;&#x53E3;&#x662F;&#x5426;&#x5F00;&#x653E;</span>
firewall-cmd --query-port=8080/tcp
<span class="hljs-comment"># &#x5F00;&#x653E;80&#x7AEF;&#x53E3;</span>
firewall-cmd --permanent --add-port=80/tcp
<span class="hljs-comment"># &#x79FB;&#x9664;&#x7AEF;&#x53E3;</span>
firewall-cmd --permanent --remove-port=8080/tcp
<span class="hljs-comment">#&#x91CD;&#x542F;&#x9632;&#x706B;&#x5899;(&#x4FEE;&#x6539;&#x914D;&#x7F6E;&#x540E;&#x8981;&#x91CD;&#x542F;&#x9632;&#x706B;&#x5899;)</span>
firewall-cmd --reload
<span class="hljs-comment"># &#x53C2;&#x6570;&#x89E3;&#x91CA;</span>
1&#x3001;firwall-cmd&#xFF1A;&#x662F;Linux&#x63D0;&#x4F9B;&#x7684;&#x64CD;&#x4F5C;firewall&#x7684;&#x4E00;&#x4E2A;&#x5DE5;&#x5177;&#xFF1B;
2&#x3001;--permanent&#xFF1A;&#x8868;&#x793A;&#x8BBE;&#x7F6E;&#x4E3A;&#x6301;&#x4E45;&#xFF1B;
3&#x3001;--add-port&#xFF1A;&#x6807;&#x8BC6;&#x6DFB;&#x52A0;&#x7684;&#x7AEF;&#x53E3;&#xFF1B;
</code></pre>
<blockquote>
<p>&#x8D1F;&#x8F7D;&#x5747;&#x8861;</p>
</blockquote>
<pre><code class="lang-bash">upstream lb{
    server 127.0.0.1:8080 weight=1;
    server 127.0.0.1:8081 weight=1;
}
location / {
    proxy_pass http://lb;
}
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="nginx02安装.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: nginx02安装">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"nginx03Nginx常用命令","level":"1.4","depth":1,"previous":{"title":"nginx02安装","level":"1.3","depth":1,"path":"nginx02安装.md","ref":"nginx02安装.md","articles":[]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"<yangxin19970404@163.com>","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Nginx","language":"zh-hans","gitbook":"3.2.3","description":"Nginx..."},"file":{"path":"nginx03Nginx常用命令.md","mtime":"2021-03-25T11:59:50.076Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-04-17T07:49:58.187Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

